package indi.gao.thread.future;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author :gaolei
 * @version :v1.0
 * @projectName :GLUtil
 * @description :
 * @createDate :2021/8/9 3:13 下午
 */
public class FutureTestFactory implements ThreadFactory {
    public static AtomicInteger atomicInteger = new AtomicInteger();

    @Override
    public Thread newThread(Runnable r) {
        Thread thread = new Thread(r);
        thread.setName(Thread.currentThread().getName() + atomicInteger.getAndIncrement());
        return thread;
    }
}
